package me.stone.stanimeclient.core.ui.di

import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.components.FragmentComponent
import dagger.hilt.android.scopes.FragmentScoped
import me.stone.stanimeclient.core.common.di.DiskExecutor
import me.stone.stanimeclient.core.ui.adapters.FanDailyUpdateAdapter
import me.stone.stanimeclient.core.ui.adapters.FanIntroListGridAdapter
import me.stone.stanimeclient.core.ui.adapters.FanRankAdapter
import me.stone.stanimeclient.core.ui.adapters.FanSimpleListAdapter
import me.stone.stanimeclient.core.ui.adapters.MultiTypeFiltersAdapter
import java.util.concurrent.Executor


@Module
@InstallIn(FragmentComponent::class)
object ProviderFragmentAdapterModule {

    @FragmentScoped
    @Provides
    fun provideDailyUpdateAdapter(
        @DiskExecutor diskExecutor: Executor
    ): FanDailyUpdateAdapter = FanDailyUpdateAdapter(diskExecutor)

    @FragmentScoped
    @Provides
    fun provideMultiTypeFiltersAdapter(
        @DiskExecutor diskExecutor: Executor
    ): MultiTypeFiltersAdapter = MultiTypeFiltersAdapter(diskExecutor)

    @FragmentScoped
    @Provides
    fun provideRankAdapter(
        @DiskExecutor diskExecutor: Executor
    ): FanRankAdapter = FanRankAdapter(diskExecutor)

    @FragmentScoped
    @Provides
    fun provideFanIntroAdapter(): FanIntroListGridAdapter = FanIntroListGridAdapter()

    @FragmentScoped
    @Provides
    fun provideFanSimpleAdapter(): FanSimpleListAdapter = FanSimpleListAdapter()

}